const state = {
  // 订单池连续跳转携带参数
  order: {
    // 订单池首次code
    code: '',
    // 第二个code
    code2: '',
    areaCode: '',
    machineCode: '',
    ordType: '',
    urlCode: '',
    // 当前激活标签页
    tabsNum: '1',
    // 返回路丫
    backUrl: ''
  }
}

const mutations = {
  // 设置order订单池一连串参数
  CLEAR_REPORT_ORDER: (state) => {
    for (const item in state.order) {
      state.order[item] = ''
    }
  },
  SET_REPORT_ORDER_code: (state, data) => {
    state.order.code = data
  },
  SET_REPORT_ORDER_code2: (state, data) => {
    state.order.code2 = data
  },
  SET_REPORT_ORDER_areaCode: (state, data) => {
    state.order.areaCode = data
  },
  SET_REPORT_ORDER_machineCode: (state, data) => {
    state.order.machineCode = data
  },
  SET_REPORT_ORDER_ordType: (state, data) => {
    state.order.ordType = data
  },
  SET_REPORT_ORDER_urlCode: (state, data) => {
    state.order.urlCode = data
  },
  SET_REPORT_ORDER_tabsNum: (state, data) => {
    state.order.tabsNum = data
  },
  SET_REPORT_ORDER_backUrl: (state, data) => {
    state.order.backUrl = data
  }
}

export default {
  namespaced: true,
  state,
  mutations

}
